Comments were collected using the PRAW, a Python wrapper for a Reddit API. The comment text was collected together with the reply-to structure (identified through comment ids and parent-ids). Using this procedure, a network structure of nodes (comments) and edges (reply-to-structure) was constructed. Discussion (sub)threads were identified using the network metric of weakly connected components. Within one API call, PRAW collects either comments or submissions, not both belonging together, therefore these discussion threads are considered as sub-treads, starting with root comments, comments directly commenting a reddit submission or post.
Another API call using PRAW collected the submissions that triggered the root-comments. They were traced back using the parent-id of the root comments. In other words, the mothers for all the small comment threads had to be identified in order to merge sibling-threads, belonging to one original trigger-mother-submission, together.
These trigger submissions were manually coded with qualitative content analysis. A code of 1 indicates content that expresses skepticism about the relationship between climate change and wildfires, while a code of 0 indicates the opposite: concern about this very relation. A code of 2 indicates that the content does not directly relate to wildfires but that e.g. the word “fire” was used in a metaphorical way (e.g. “Someone is on fire.”). The following tables display the summary statistics for the discussion thread characteristics of the whole threads, the sub-treads and the comments.
In a manual step, the thread / sub-thread matching was checked.

## Data preparation 

library(tidyverse)
library(ggplot2)
library(readr)
library(readxl)
library(xtable)
library(knitr)
library(kableExtra)
library(writexl)

data_cc_networks <- read_excel("../../data/final/data_cc_networks_coded.xlsx")

## get depth metric for overall (big) thread

data_cc_networks <- data_cc_networks %>%
  group_by(id_sub)%>%
  mutate(thread_depth = max(depths))

## get with metric for overall (big) thread

data_cc_networks <- data_cc_networks %>%
  group_by(id_sub)%>%
  mutate(thread_width = max(widths))

## compress data set to trigger submissions only

threads <- data_cc_networks%>%
  filter(type_sub != "is.na")

## load comment level data
reddit_df_indegree <- read_csv("../../data/raw/reddit_df_indegree_thread_id.csv")

## merge comment data with trigger submissions

fire_data <- merge(x = threads, y = reddit_df_indegree, by.x = "id_rc", by.y = "id" , all = TRUE)

fire_data <- fire_data%>%
  group_by(subreddit, wave.y)%>%
  arrange(thread_id)

# help with sorting subthreads to submissions

fire_data <- fire_data%>%
  group_by(subreddit_y, wave.y, thread_id)%>%
  mutate(sub_thread_id = group_indices())

#write_xlsx(fire_data,"data/temp/fire_data.xlsx")

# manual match contolling & thread sorting

#### creating final dataset #####
data <- read_excel("../../data/temp/fire_data_clean.xlsx")

# opposing variables 
data <- data%>%
  mutate(opposing = ifelse((type_sub == 1 & subreddit == "climatechange"), 1, 
                    ifelse((type_sub == 0 & subreddit == "climateskeptics"), 1, 0)))

#write_xlsx(data,"data/temp/data_fire_cc.xlsx")

Sample

data <- read_excel("../../data/temp/data_fire_cc.xlsx")

#data <- data.frame(na.omit(data))

data <- data%>%
  mutate(type_sub = recode(type_sub, "3" = 1))

# 1543 comments
length(unique(data$id_c))

# written by 572 unique authors
length(unique(data$author_c))

# 524 sub-threads
length(unique(data$thread_id))

# 115 threads
length(unique(data$id_sub))

# 62 unique authors writing the submissions
length(unique(data$author_sub))

#### opposing content #####
opposing_data <- data%>%
  filter(opposing == 1)

# 168 / 1543 opposing comments
length(unique(opposing_data$id_c))
# written by 93 authors
length(unique(opposing_data$author_c))

# 86 / 524 sub-threads
length(unique(opposing_data$thread_id))

# 21 / 115 threads
length(unique(opposing_data$id_sub))
# written by 16 authors
length(unique(opposing_data$author_sub))

# unrelated comments 
table(data$type_sub)

thread_data <- data %>% 
  group_by(id_sub) %>% slice(1)

table(thread_data$type_sub)

NAs kept

The final dataset consists of 1543 comments, written by written by 572 different authors. These comments belong to 524 sub-threads and 115 threads. The trigger submission for the 115 threads were written by 62 unique authors. 168 out of the 1543 comments followed 21 submissions with opposing content relative to the subreddit’s mainstream content. These opposing submission were written by 16 different authors. In total, 7 threads did not contain discussions on the 2020 wildfires but e.g. used the word ‘fire’ in a metaphorical way. They were excluded from the analyses.

NAs removed

The final dataset consists of 1404 comments, written by written by 543 different authors. These comments belong to 472 sub-threads and 108 threads. The trigger submission for the 108 threads were written by 61 unique authors. 150 out of the 1404 comments followed 20 submissions with opposing content relative to the subreddit’s mainstream content. These opposing submission were written by 15 different authors. In total, 6 threads including 60 comments did not contain discussions on the 2020 wildfires but e.g. used the word ‘fire’ in a metaphorical way. They were excluded from the dataset.

# split waves 
data_cal <- data%>%
  filter(wave == "california")

data_aus <- data%>%
  filter(wave == "australia")

Summary Statistics for different Discussion Threads

Ausralia Data

options(digits = 3)

data_aus %>%  
  group_by(subreddit, opposing)%>%
  summarize(max_depth = max(max_thread_depth), mean_depth = mean(max_thread_depth),
            max_widht = max(mean_thread_width), mean_width = mean(mean_thread_width),
            max_ups = max(ups_sub), mean_ups = mean(ups_sub),
            max_comms = max(n_comments_sub), mean_coms = mean(n_comments_sub)) %>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit opposing max_depth mean_depth max_widht mean_width max_ups mean_ups max_comms mean_coms
climatechange 0 28 10.43 0.980 0.911 143 90.1 74 36.8
climatechange 1 6 4.22 0.833 0.715 62 18.4 19 14.9
climatechange NA NA NA NA NA NA NA NA NA
climateskeptics 0 13 6.55 0.962 0.761 118 65.1 30 13.9
climateskeptics 1 23 23.00 0.964 0.964 0 0.0 32 32.0

California Data

# create summary tables for deliberative structure estimates
data_cal %>%  
  group_by(subreddit, opposing)%>%
  summarize(max_depth = max(max_thread_depth), mean_depth = mean(max_thread_depth),
            max_widht = max(mean_thread_width), mean_width = mean(mean_thread_width),
            max_ups = max(ups_sub), mean_ups = mean(ups_sub),
            max_comms = max(n_comments_sub), mean_coms = mean(n_comments_sub)) %>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit opposing max_depth mean_depth max_widht mean_width max_ups mean_ups max_comms mean_coms
climatechange 0 8 5.21 0.909 0.812 136 75.18 22 15.4
climatechange 1 8 5.00 0.909 0.701 13 3.32 16 12.5
climateskeptics 0 25 8.56 0.971 0.837 254 127.17 97 44.6
climateskeptics 1 3 2.46 0.750 0.591 11 3.42 19 10.9
climateskeptics NA NA NA NA NA NA NA NA NA

Group sizes

Number of Comments

data%>%
  group_by(subreddit, wave)%>%
  summarise(n())%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave n()
climatechange australia 598
climatechange california 170
climateskeptics australia 126
climateskeptics california 648
NA NA 194

Number of Threads

thread_data%>%
  group_by(subreddit, wave)%>%
  summarise(n())%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave n()
climatechange australia 30
climatechange california 18
climateskeptics australia 16
climateskeptics california 51

Different Width estimates

  1. Mean in-degrees of comments per thread
  2. Number of different users engaged in thread
  3. Maximum width of thread at any given depth level
# Mean in-degree
ggplot()+
  geom_histogram(aes(data$mean_thread_width))+
  xlab("Mean in-degrees of comments per thread")

# Unique authors
data <- data%>%
  dplyr::group_by(id_sub)%>%
  dplyr::mutate(unique_authors = n_distinct(author_c))

ggplot()+
  geom_histogram(aes(data$unique_authors))+
  xlab("Number of unique authors engaged in thread")

# Maximum width (number of comments) on a given depth level
data <- data%>%
  group_by(id_sub, depth_c)%>%
  mutate(width_values = sum(in_degree_com))%>%
  group_by(id_sub)%>%
  mutate(gonzalez_width = max(width_values))

ggplot()+
  geom_histogram(aes(data$gonzalez_width))+
  xlab("Maximum width of thread at any given depth level")

Summary statistics - comment level

# drop NAs
data <- data.frame(na.omit(data)) ### impute NAs to keep full sample??

One node represents one comment, in-degrees represent indegrees of comments (how many replies did one comment get), ups refer to comments (how many ups did one comment get)

# plot in_degree distributions

ggplot(data, aes(n_comments_sub, mean_thread_width))+
  geom_point(aes(colour = as.factor(opposing), size = ups_sub), 
             position = position_jitter(width = 10, height = 0.08),
             alpha = 0.5)+
  geom_point(data = subset(data, opposing == 1), aes(colour = as.factor(opposing), size = ups_sub), 
             position = position_jitter(width = 10, height = 0.08),
             alpha = 0.5)+
  theme_minimal()+
  facet_grid(vars(wave), vars(subreddit))+
  xlab("Number of Comments")+
  ylab("Width (in-degree)")+
  scale_colour_manual(name="Type",
                        labels=c("congruent", "opposing"),
                        values=c("#2E8B57", "indianred")) +
  scale_size_continuous(name="Up-votes")

# plot in_degree distributions

ggplot(data, aes(max_thread_depth, mean_thread_width))+
  geom_point(aes(colour = as.factor(opposing), size = ups_sub), 
             position = position_jitter(width = 6, height = 0.08),
             alpha = 0.5)+
  geom_point(data = subset(data, opposing == 1), aes(colour = as.factor(opposing), size = ups_sub), 
             position = position_jitter(width = 6, height = 0.08),
             alpha = 0.5)+
  theme_minimal()+
  facet_grid(vars(wave), vars(subreddit))+
  xlab("Depth")+
  ylab("Width (in-degree)")+
  scale_colour_manual(name="Type",
                        labels=c("congruent", "opposing"),
                        values=c("#2E8B57", "indianred")) +
  scale_size_continuous(name="Up-votes")

ggplot(data, aes(max_thread_depth, mean_thread_width))+
  geom_point(aes(colour = as.factor(opposing), size = n_comments_sub), 
             #position = position_jitter(width = 3, height = 0.08),
             alpha = 0.5)+
  geom_point(data = subset(data, opposing == 1), 
             aes(colour = as.factor(opposing), size = ups_sub), 
             äposition = position_jitter(width = 3, height = 0.08),
             alpha = 0.5)+
  #theme_grey()+
  facet_grid(vars(wave), vars(subreddit))+
  xlab("Depth")+
  ylab("Width (in-degree)")+
  scale_colour_manual(name="Type",
                        labels=c("congruent", "opposing"),
                        values=c("#2E8B57", "indianred")) +
  scale_size_continuous(name="N comments")

Hpyotheses Tests

H1: Threads in reaction to opposing views have lower scores.

par(mar = c(4, 4, .1, .1))

# comment level data

data$opposing <- as.factor(data$opposing)

my.mean<-tapply(data[,"ups_sub"],data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(data[,"ups_sub"],data[,"opposing"],sd)
my.nr<-as.vector(table(data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 102.7 67.5 1.91
1 opposing 10.6 20.5 1.67
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("indianred")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=15),
    axis.title.y = element_text( colour="black", size=15))+
  labs(x="",y="mean up-votes of submissions",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data

thread_data <- data.frame(thread_data)

thread_data$opposing <- as.factor(thread_data$opposing)

my.mean<-tapply(thread_data[,"ups_sub"],thread_data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"ups_sub"],thread_data[,"opposing"],sd)
my.nr<-as.vector(table(thread_data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 62.70 57.9 5.97
1 opposing 6.45 13.7 3.05
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("indianred")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=15),
    axis.title.y = element_text( colour="black", size=15))+
  labs(x="",y="mean up-votes of submissions", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

thread_data <- data.frame(thread_data)
thread_data$opposing <- as.factor(thread_data$opposing)

df <- thread_data %>% 
  group_by(subreddit, wave, opposing)%>%
  summarise(se = sd(ups_sub)/sqrt(length(ups_sub)),
                     mean = mean(ups_sub))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 11.04 64.0
climatechange australia 1 10.04 12.2
climatechange australia NA NA NA
climatechange california 0 12.89 55.1
climatechange california 1 1.83 3.2
climateskeptics australia 0 9.59 36.5
climateskeptics australia 1 NA 0.0
climateskeptics california 0 10.22 73.5
climateskeptics california 1 1.64 5.0
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("indianred2", "indianred4"))+
  labs(x="opposing submission content",y="mean up-votes of submissions", title="Thread level data")+
  facet_grid(vars(wave))

T-Test for opposing vs. congruent submissions

# overall t-test
t.test(thread_data$ups_sub ~ thread_data$opposing)

    Welch Two Sample t-test

data:  thread_data$ups_sub by thread_data$opposing
t = 8, df = 111, p-value = 2e-13
alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
95 percent confidence interval:
 43.0 69.5
sample estimates:
mean in group 0 mean in group 1 
          62.70            6.45 

ANOVA for opposing vs. congruent x wave

# overall t-test
summary(aov(ups_sub ~ opposing + wave + opposing * wave, data = thread_data))
               Df Sum Sq Mean Sq F value  Pr(>F)    
opposing        1  52183   52183   18.57 3.6e-05 ***
wave            1   4148    4148    1.48    0.23    
opposing:wave   1   1865    1865    0.66    0.42    
Residuals     110 309172    2811                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness

ANOVA for opposing vs. congruent x ideology (subreddit)

# overall t-test
summary(aov(ups_sub ~ opposing + subreddit + opposing * subreddit, data = thread_data))
                    Df Sum Sq Mean Sq F value  Pr(>F)    
opposing             1  52183   52183   18.23 4.2e-05 ***
subreddit            1    100     100    0.04    0.85    
opposing:subreddit   1    188     188    0.07    0.80    
Residuals          110 314896    2863                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness

3-way ANOVA for opposing vs. congruent x ideology (subreddit) x wave

# overall t-test
summary(aov(ups_sub ~ opposing + subreddit + wave + opposing * subreddit + opposing * wave + subreddit * wave + 
              subreddit * opposing * wave, data = thread_data))
                         Df Sum Sq Mean Sq F value  Pr(>F)    
opposing                  1  52183   52183   18.51 3.8e-05 ***
subreddit                 1    100     100    0.04   0.851    
wave                      1   4316    4316    1.53   0.219    
opposing:subreddit        1    231     231    0.08   0.775    
opposing:wave             1   1596    1596    0.57   0.453    
subreddit:wave            1   9513    9513    3.37   0.069 .  
opposing:subreddit:wave   1    596     596    0.21   0.647    
Residuals               106 298832    2819                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness

H2: Threads in reaction to opposing views have higher number of comments.

par(mar = c(4, 4, .1, .1))
# comment level data

data$opposing <- as.factor(data$opposing)

my.mean<-tapply(data[,"n_comments_sub"],data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(data[,"n_comments_sub"],data[,"opposing"],sd)
my.nr<-as.vector(table(data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 35.4 25.53 0.721
1 opposing 15.2 8.68 0.709
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("goldenrod")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="mean number of comments to submissions",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)


# thread level data

thread_data <- data.frame(thread_data)

thread_data$opposing <- as.factor(thread_data$opposing)

my.mean<-tapply(thread_data[,"n_comments_sub"],thread_data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"n_comments_sub"],thread_data[,"opposing"],sd)
my.nr<-as.vector(table(thread_data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 19.47 22.46 2.32
1 opposing 8.85 8.55 1.91
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("goldenrod")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="mean number of comments to submissions", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

thread_data <- data.frame(thread_data)
thread_data$opposing <- as.factor(thread_data$opposing)

df <- thread_data %>% 
  group_by(subreddit, wave, opposing)%>%
  summarise(se = sd(n_comments_sub)/sqrt(length(n_comments_sub)),
                     mean = mean(n_comments_sub))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 4.05 24.22
climatechange australia 1 2.79 11.67
climatechange australia NA NA NA
climatechange california 0 2.09 10.46
climatechange california 1 3.20 6.80
climateskeptics australia 0 1.96 7.00
climateskeptics australia 1 NA 32.00
climateskeptics california 0 4.23 24.00
climateskeptics california 1 2.05 5.12
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("goldenrod", "gold"))+
  labs(x="opposing submission content",y="mean number of comments to submissions", title="Thread level data")+
  facet_grid(vars(wave))

H3: Threads in reaction to opposing views are deeper.

par(mar = c(4, 4, .1, .1))
# comment level data

data$opposing <- as.factor(data$opposing)

my.mean<-tapply(data[,"max_thread_depth"],data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(data[,"max_thread_depth"],data[,"opposing"],sd)
my.nr<-as.vector(table(data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 8.23 4.25 0.120
1 opposing 6.45 6.78 0.554
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("skyblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="maximum depth of threads",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data

thread_data <- data.frame(thread_data)

thread_data$opposing <- as.factor(thread_data$opposing)

my.mean<-tapply(thread_data[,"max_thread_depth"],thread_data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"max_thread_depth"],thread_data[,"opposing"],sd)
my.nr<-as.vector(table(thread_data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 5.61 5.11 0.527
1 opposing 3.70 4.92 1.100
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("skyblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="maximum depth of threads", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

thread_data <- data.frame(thread_data)
thread_data$opposing <- as.factor(thread_data$opposing)

df <- thread_data %>% 
  group_by(subreddit, wave, opposing)%>%
  summarise(se = sd(max_thread_depth)/sqrt(length(max_thread_depth)),
                     mean = mean(max_thread_depth))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 1.273 7.26
climatechange australia 1 0.803 3.33
climatechange australia NA NA NA
climatechange california 0 0.679 4.00
climatechange california 1 1.378 3.00
climateskeptics australia 0 0.875 3.73
climateskeptics australia 1 NA 23.00
climateskeptics california 0 0.824 5.86
climateskeptics california 1 0.267 2.00
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("skyblue", "slateblue"))+
  labs(x="opposing submission content",y="maximum depth of threads", title="Thread level data")+
  facet_grid(vars(wave))

T-Test for opposing vs. congruent submissions

# overall t-test
t.test(thread_data$max_thread_depth ~ thread_data$opposing)

    Welch Two Sample t-test

data:  thread_data$max_thread_depth by thread_data$opposing
t = 2, df = 28, p-value = 0.1
alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
95 percent confidence interval:
 -0.592  4.405
sample estimates:
mean in group 0 mean in group 1 
           5.61            3.70 

ANOVA for opposing vs. congruent x wave

summary(aov(max_thread_depth ~ opposing + wave + opposing * wave, data = thread_data))
               Df Sum Sq Mean Sq F value Pr(>F)
opposing        1     60    59.9    2.33   0.13
wave            1     27    26.9    1.05   0.31
opposing:wave   1     42    41.7    1.63   0.21
Residuals     110   2824    25.7               
1 observation deleted due to missingness

ANOVA for opposing vs. congruent x ideology (subreddit)

summary(aov(max_thread_depth ~ opposing + subreddit + opposing * subreddit, data = thread_data))
                    Df Sum Sq Mean Sq F value Pr(>F)
opposing             1     60    59.9    2.29   0.13
subreddit            1      5     4.8    0.19   0.67
opposing:subreddit   1     15    15.0    0.57   0.45
Residuals          110   2873    26.1               
1 observation deleted due to missingness

3-way ANOVA for opposing vs. congruent x ideology (subreddit) x wave

summary(aov(max_thread_depth ~ opposing + subreddit + wave + opposing * subreddit + opposing * wave + subreddit * wave + 
              subreddit * opposing * wave, data = thread_data))
                         Df Sum Sq Mean Sq F value  Pr(>F)    
opposing                  1     60      60    2.71   0.103    
subreddit                 1      5       5    0.22   0.641    
wave                      1     22      22    1.00   0.319    
opposing:subreddit        1     16      16    0.72   0.399    
opposing:wave             1     84      84    3.78   0.054 .  
subreddit:wave            1     26      26    1.15   0.285    
opposing:subreddit:wave   1    399     399   18.05 4.6e-05 ***
Residuals               106   2342      22                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness

H4: Threads in reaction to congruent views are wider.

par(mar = c(4, 4, .1, .1))
# comment level data

data$opposing <- as.factor(data$opposing)

my.mean<-tapply(data[,"mean_thread_width"],data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(data[,"mean_thread_width"],data[,"opposing"],sd)
my.nr<-as.vector(table(data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 0.856 0.182 0.005
1 opposing 0.707 0.282 0.023
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="mean widdth of threads",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data

thread_data <- data.frame(thread_data)

thread_data$opposing <- as.factor(thread_data$opposing)

my.mean<-tapply(thread_data[,"mean_thread_width"],thread_data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"mean_thread_width"],thread_data[,"opposing"],sd)
my.nr<-as.vector(table(thread_data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 0.644 0.354 0.037
1 opposing 0.465 0.374 0.084
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="mean widdth of threads", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

thread_data <- data.frame(thread_data)
thread_data$opposing <- as.factor(thread_data$opposing)

df <- thread_data %>% 
  group_by(subreddit, wave, opposing)%>%
  summarise(se = sd(mean_thread_width)/sqrt(length(mean_thread_width)),
                     mean = mean(mean_thread_width))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 0.067 0.757
climatechange australia 1 0.170 0.536
climatechange australia NA NA NA
climatechange california 0 0.087 0.661
climatechange california 1 0.210 0.342
climateskeptics australia 0 0.101 0.495
climateskeptics australia 1 NA 0.964
climateskeptics california 0 0.055 0.631
climateskeptics california 1 0.099 0.427
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("steelblue2", "steelblue4"))+
  labs(x="opposing submission content",y="mean widdth of threads", title="Thread level data")+
  facet_grid(vars(wave))

Deliberative Structure

Creating measure for further analyses / comparison with deliberative quality: deliberative structure. mean_width x max_depth

data <- data%>%
  mutate(del_structure = max_thread_depth*mean_thread_width)
par(mar = c(4, 4, .1, .1))
# comment level data

my.mean<-tapply(data[,"del_structure"],data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(data[,"del_structure"],data[,"opposing"],sd)
my.nr<-as.vector(table(data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 7.55 4.34 0.123
1 opposing 5.59 6.80 0.556
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("seagreen")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="deliberative structure of threads",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data
thread_data <- data %>% 
  group_by(id_sub) %>% slice(1)

thread_data <- data.frame(thread_data)

my.mean<-tapply(thread_data[,"del_structure"],thread_data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"del_structure"],thread_data[,"opposing"],sd)
my.nr<-as.vector(table(thread_data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 4.67 4.73 0.501
1 opposing 2.76 5.11 1.172
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("seagreen")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="deliberative structure of threads", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

df <- thread_data %>% 
  group_by(subreddit, wave, opposing)%>%
  summarise(se = sd(del_structure)/sqrt(length(del_structure)),
                     mean = mean(del_structure))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 0.975 5.76
climatechange australia 1 0.994 2.31
climatechange california 0 0.686 3.16
climatechange california 1 1.435 2.10
climateskeptics australia 0 1.017 3.20
climateskeptics australia 1 NA 22.18
climateskeptics california 0 0.843 5.05
climateskeptics california 1 0.285 1.03
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("seagreen", "seagreen3"))+
  labs(x="opposing submission content",y="deliberative structure of threads", title="Thread   level data")+
  facet_grid(vars(wave))

T-Test for opposing vs. congruent submissions

# overall t-test
t.test(thread_data$del_structure ~ thread_data$opposing)

    Welch Two Sample t-test

data:  thread_data$del_structure by thread_data$opposing
t = 1, df = 25, p-value = 0.1
alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
95 percent confidence interval:
 -0.72  4.53
sample estimates:
mean in group 0 mean in group 1 
           4.66            2.76 

ANOVA for opposing vs. congruent x wave

summary(aov(del_structure ~ opposing + wave + opposing * wave, data = thread_data))
               Df Sum Sq Mean Sq F value Pr(>F)
opposing        1     57    56.8    2.50   0.12
wave            1     16    16.1    0.71   0.40
opposing:wave   1     56    56.0    2.46   0.12
Residuals     104   2364    22.7               

ANOVA for opposing vs. congruent x ideology (subreddit)

summary(aov(del_structure ~ opposing + subreddit + opposing * subreddit, data = thread_data))
                    Df Sum Sq Mean Sq F value Pr(>F)
opposing             1     57    56.8    2.43   0.12
subreddit            1      0     0.4    0.02   0.90
opposing:subreddit   1      6     6.5    0.28   0.60
Residuals          104   2430    23.4               

3-way ANOVA for opposing vs. congruent x ideology (subreddit) x wave

summary(aov(del_structure ~ opposing + subreddit + wave + opposing * subreddit + opposing * wave + subreddit * wave + 
              subreddit * opposing * wave, data = thread_data))
                         Df Sum Sq Mean Sq F value  Pr(>F)    
opposing                  1     57      57    2.92   0.090 .  
subreddit                 1      0       0    0.02   0.887    
wave                      1     21      21    1.09   0.299    
opposing:subreddit        1      7       7    0.34   0.560    
opposing:wave             1     89      89    4.58   0.035 *  
subreddit:wave            1      7       7    0.35   0.554    
opposing:subreddit:wave   1    368     368   18.92 3.3e-05 ***
Residuals               100   1944      19                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Further Ideas

Alternative Measure for width (representation) –> number of unique users involved

ggplot(data, aes(max_thread_depth, unique_authors))+
  geom_point(aes(colour = as.factor(opposing), size = n_comments_sub), 
             position = position_jitter(width = 2, height = 5),
             alpha = 0.5)+
  geom_point(data = subset(data, opposing == 1), 
             aes(colour = as.factor(opposing), size = ups_sub), 
             position = position_jitter(width = 2, height = 5),
             alpha = 0.5)+
  #theme_grey()+
  facet_grid(vars(wave), vars(subreddit))+
  xlab("Depth")+
  ylab("Width (engaged users)")+
  scale_colour_manual(name="Type",
                        labels=c("congruent", "opposing"),
                        values=c("#2E8B57", "indianred")) +
  scale_size_continuous(name="N comments")

par(mar = c(4, 4, .1, .1))
# comment level data

my.mean<-tapply(data[,"unique_authors"],data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(data[,"unique_authors"],data[,"opposing"],sd)
my.nr<-as.vector(table(data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 17.47 11.59 0.327
1 opposing 9.03 5.08 0.415
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="Number of different authors involved in threads",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data
thread_data <- data %>% 
  group_by(id_sub) %>% slice(1)

thread_data <- data.frame(thread_data)

my.mean<-tapply(thread_data[,"unique_authors"],thread_data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"unique_authors"],thread_data[,"opposing"],sd)
my.nr<-as.vector(table(thread_data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 8.38 8.30 0.88
1 opposing 5.47 4.95 1.14
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="Authors involved in threads", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

df <- thread_data %>% 
  group_by(subreddit, wave, opposing)%>%
  summarise(se = sd(unique_authors)/sqrt(length(unique_authors)),
                     mean = mean(unique_authors))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 1.74 11.45
climatechange australia 1 2.27 7.60
climatechange california 0 1.49 7.46
climatechange california 1 2.46 4.60
climateskeptics australia 0 1.02 4.62
climateskeptics australia 1 NA 6.00
climateskeptics california 0 1.49 8.37
climateskeptics california 1 1.81 4.62
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("steelblue4", "steelblue2"))+
  labs(x="opposing submission content",y="Authors involved in threads", title="Thread level data")+
  facet_grid(vars(wave))

T-Test for opposing vs. congruent submissions

# overall t-test
t.test(thread_data$unique_authors ~ thread_data$opposing)

    Welch Two Sample t-test

data:  thread_data$unique_authors by thread_data$opposing
t = 2, df = 43, p-value = 0.05
alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
95 percent confidence interval:
 0.0121 5.8046
sample estimates:
mean in group 0 mean in group 1 
           8.38            5.47 

ANOVA for opposing vs. congruent x wave

summary(aov(unique_authors ~ opposing + wave + opposing * wave, data = thread_data))
               Df Sum Sq Mean Sq F value Pr(>F)
opposing        1    132   132.4    2.13   0.15
wave            1     22    22.3    0.36   0.55
opposing:wave   1     15    15.4    0.25   0.62
Residuals     104   6462    62.1               

ANOVA for opposing vs. congruent x ideology (subreddit)

summary(aov(unique_authors ~ opposing + subreddit + opposing * subreddit, data = thread_data))
                    Df Sum Sq Mean Sq F value Pr(>F)
opposing             1    132   132.4    2.16   0.14
subreddit            1    121   121.5    1.98   0.16
opposing:subreddit   1      4     4.3    0.07   0.79
Residuals          104   6374    61.3               

3-way ANOVA for opposing vs. congruent x ideology (subreddit) x wave

summary(aov(unique_authors ~ opposing + subreddit + wave + opposing * subreddit + opposing * wave + subreddit * wave + 
              subreddit * opposing * wave, data = thread_data))
                         Df Sum Sq Mean Sq F value Pr(>F)  
opposing                  1    132   132.4    2.18  0.143  
subreddit                 1    121   121.5    2.00  0.161  
wave                      1      0     0.3    0.01  0.943  
opposing:subreddit        1      4     4.3    0.07  0.790  
opposing:wave             1     24    24.2    0.40  0.530  
subreddit:wave            1    244   244.5    4.02  0.048 *
opposing:subreddit:wave   1     21    21.4    0.35  0.555  
Residuals               100   6084    60.8                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Deliberative Structure / Complexity –> Users

Creating measure for further analyses / comparison with deliberative quality: deliberative structure. unique_authors x max_depth

data <- data%>%
  mutate(del_complexity = max_thread_depth*unique_authors)

thread_data <- data %>% 
  group_by(id_sub) %>% slice(1)

thread_data <- data.frame(thread_data)
par(mar = c(4, 4, .1, .1))
# comment level data

my.mean<-tapply(data[,"del_complexity"],data[,"subreddit"],mean, na.rm =T)
my.sd<-tapply(data[,"del_complexity"],data[,"subreddit"],sd)
my.nr<-as.vector(table(data[,"subreddit"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("climate change","climate skeptics")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
climatechange climate change 122 92.3 3.58
climateskeptics climate skeptics 191 213.0 7.83
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="deliberative complexity of threads",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data

my.mean<-tapply(thread_data[,"del_complexity"],thread_data[,"subreddit"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"del_complexity"],thread_data[,"subreddit"],sd)
my.nr<-as.vector(table(thread_data[,"subreddit"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("climate change","climate skeptics")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
climatechange climate change 61.2 74.8 11.4
climateskeptics climate skeptics 49.5 105.7 13.1
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue3")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="deliberative complexity of threads", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

df <- thread_data %>% 
  dplyr::group_by(subreddit, wave, opposing)%>%
  dplyr::summarise(se = sd(del_complexity)/sqrt(length(del_complexity)),
                     mean = mean(del_complexity))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 21.08 95.4
climatechange australia 1 15.12 31.2
climatechange california 0 9.46 36.1
climatechange california 1 11.71 20.0
climateskeptics australia 0 9.94 26.1
climateskeptics australia 1 NA 138.0
climateskeptics california 0 19.18 61.7
climateskeptics california 1 5.77 11.1
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("seagreen", "seagreen3"))+
  labs(x="opposing submission content",y="deliberative complexity of threads", title="Thread level data")+
  facet_grid(vars(wave))

T-Test for opposing vs. congruent submissions

# overall t-test
t.test(thread_data$del_complexity ~ thread_data$opposing)

    Welch Two Sample t-test

data:  thread_data$del_complexity by thread_data$opposing
t = 3, df = 82, p-value = 0.01
alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
95 percent confidence interval:
  7.79 62.02
sample estimates:
mean in group 0 mean in group 1 
           60.3            25.4 

ANOVA for opposing vs. congruent x wave

summary(aov(del_complexity ~ opposing + wave + opposing * wave, data = thread_data))
               Df Sum Sq Mean Sq F value Pr(>F)
opposing        1  19076   19076    2.14   0.15
wave            1   6361    6361    0.71   0.40
opposing:wave   1   1677    1677    0.19   0.67
Residuals     104 925760    8902               

ANOVA for opposing vs. congruent x ideology (subreddit)

summary(aov(del_complexity ~ opposing + subreddit + opposing * subreddit, data = thread_data))
                    Df Sum Sq Mean Sq F value Pr(>F)
opposing             1  19076   19076    2.14   0.15
subreddit            1   5905    5905    0.66   0.42
opposing:subreddit   1   1281    1281    0.14   0.71
Residuals          104 926613    8910               

3-way ANOVA for opposing vs. congruent x ideology (subreddit) x wave

summary(aov(del_complexity ~ opposing + subreddit + wave + opposing * subreddit + opposing * wave + subreddit * wave + 
              subreddit * opposing * wave, data = thread_data))
                         Df Sum Sq Mean Sq F value Pr(>F)  
opposing                  1  19076   19076    2.19  0.142  
subreddit                 1   5905    5905    0.68  0.412  
wave                      1   2978    2978    0.34  0.560  
opposing:subreddit        1   1306    1306    0.15  0.700  
opposing:wave             1   3545    3545    0.41  0.525  
subreddit:wave            1  23149   23149    2.66  0.106  
opposing:subreddit:wave   1  25318   25318    2.90  0.091 .
Residuals               100 871597    8716                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Gonzalez Width

ggplot(data, aes(max_thread_depth, gonzalez_width))+
  geom_point(aes(colour = as.factor(opposing), size = n_comments_sub), 
             position = position_jitter(width = 2, height = 5),
             alpha = 0.5)+
  geom_point(data = subset(data, opposing == 1), 
             aes(colour = as.factor(opposing), size = ups_sub), 
             position = position_jitter(width = 2, height = 5),
             alpha = 0.5)+
  #theme_grey()+
  facet_grid(vars(wave), vars(subreddit))+
  xlab("Depth")+
  ylab("Width (Gonzalez-Bailon, 2010)")+
  scale_colour_manual(name="Type",
                        labels=c("congruent", "opposing"),
                        values=c("#2E8B57", "indianred")) +
  scale_size_continuous(name="N comments")

par(mar = c(4, 4, .1, .1))
# comment level data

my.mean<-tapply(data[,"gonzalez_width"],data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(data[,"gonzalez_width"],data[,"opposing"],sd)
my.nr<-as.vector(table(data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 8.01 5.45 0.154
1 opposing 3.37 2.09 0.171
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="Maximum width of comment thread at any given depth",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data
thread_data <- data %>% 
  group_by(id_sub) %>% slice(1)

thread_data <- data.frame(thread_data)

my.mean<-tapply(thread_data[,"gonzalez_width"],thread_data[,"opposing"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"gonzalez_width"],thread_data[,"opposing"],sd)
my.nr<-as.vector(table(thread_data[,"opposing"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("congruent","opposing")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
0 congruent 3.48 4.11 0.436
1 opposing 1.79 2.10 0.481
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="Maximum width of comment thread at any given depth", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

df <- thread_data %>% 
  group_by(subreddit, wave, opposing)%>%
  summarise(se = sd(gonzalez_width)/sqrt(length(gonzalez_width)),
                     mean = mean(gonzalez_width))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 0.801 5.25
climatechange australia 1 1.393 3.20
climatechange california 0 0.514 2.54
climatechange california 1 0.632 1.00
climateskeptics australia 0 0.512 1.92
climateskeptics australia 1 NA 4.00
climateskeptics california 0 0.764 3.42
climateskeptics california 1 0.441 1.12
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("steelblue4", "steelblue2"))+
  labs(x="opposing submission content",y="G Width of threads", title="Thread level data")+
  facet_grid(vars(wave))

T-Test for opposing vs. congruent submissions

# overall t-test
t.test(thread_data$gonzalez_width ~ thread_data$opposing)

    Welch Two Sample t-test

data:  thread_data$gonzalez_width by thread_data$opposing
t = 3, df = 52, p-value = 0.01
alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
95 percent confidence interval:
 0.392 2.996
sample estimates:
mean in group 0 mean in group 1 
           3.48            1.79 

ANOVA for opposing vs. congruent x wave

summary(aov(gonzalez_width ~ opposing + wave + opposing * wave, data = thread_data))
               Df Sum Sq Mean Sq F value Pr(>F)  
opposing        1     45    44.9    3.05  0.084 .
wave            1     24    23.8    1.61  0.207  
opposing:wave   1      8     8.0    0.55  0.462  
Residuals     104   1534    14.7                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ANOVA for opposing vs. congruent x ideology (subreddit)

summary(aov(gonzalez_width ~ opposing + subreddit + opposing * subreddit, data = thread_data))
                    Df Sum Sq Mean Sq F value Pr(>F)  
opposing             1     45    44.9    3.04  0.084 .
subreddit            1     27    26.8    1.82  0.181  
opposing:subreddit   1      1     0.8    0.05  0.817  
Residuals          104   1538    14.8                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

3-way ANOVA for opposing vs. congruent x ideology (subreddit) x wave

summary(aov(gonzalez_width ~ opposing + subreddit + wave + opposing * subreddit + opposing * wave + subreddit * wave + 
              subreddit * opposing * wave, data = thread_data))
                         Df Sum Sq Mean Sq F value Pr(>F)  
opposing                  1     45    44.9    3.12  0.080 .
subreddit                 1     27    26.8    1.87  0.175  
wave                      1     10     9.8    0.68  0.410  
opposing:subreddit        1      1     0.8    0.06  0.810  
opposing:wave             1     12    11.6    0.81  0.372  
subreddit:wave            1     65    64.6    4.49  0.036 *
opposing:subreddit:wave   1     14    13.6    0.95  0.333  
Residuals               100   1438    14.4                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Deliberative Structure / Complexity –> Gonzalez Width

Creating measure for further analyses / comparison with deliberative quality: deliberative structure. gonzalez_width x max_depth

data <- data%>%
  mutate(del_complexity = max_thread_depth*gonzalez_width)

thread_data <- data %>% 
  group_by(id_sub) %>% slice(1)

thread_data <- data.frame(thread_data)

ggplot(data, aes(max_thread_depth, gonzalez_width))+
  geom_point(aes(colour = as.factor(opposing), size = n_comments_sub), 
             position = position_jitter(width = 3, height = 3),
             alpha = 0.5)+
  geom_point(data = subset(data, opposing == 1), aes(colour = as.factor(opposing), size = ups_sub), 
             position = position_jitter(width = 6, height = 0.08),
             alpha = 0.5)+
  theme_minimal()+
  facet_grid(vars(wave), vars(subreddit))+
  xlab("Depth")+
  ylab("Width")+
  scale_colour_manual(name="Type",
                        labels=c("congruent", "opposing"),
                        values=c("#2E8B57", "indianred")) +
  scale_size_continuous(name="Number of Comments")

ggsave(file="../../output/G_width_depth.png",width = 8, height = 6, dpi = 500)
par(mar = c(4, 4, .1, .1))
# comment level data

my.mean<-tapply(data[,"del_complexity"],data[,"subreddit"],mean, na.rm =T)
my.sd<-tapply(data[,"del_complexity"],data[,"subreddit"],sd)
my.nr<-as.vector(table(data[,"subreddit"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("climate change","climate skeptics")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
climatechange climate change 55.1 40.5 1.57
climateskeptics climate skeptics 91.7 94.7 3.48
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="deliberative complexity of threads",title="Comment level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data

my.mean<-tapply(thread_data[,"del_complexity"],thread_data[,"subreddit"],mean, na.rm =T)
my.sd<-tapply(thread_data[,"del_complexity"],thread_data[,"subreddit"],sd)
my.nr<-as.vector(table(thread_data[,"subreddit"]))
my.se<-my.sd/sqrt(my.nr)

my.df<-data.frame(groups=factor(names(my.mean),labels =c("climate change","climate skeptics")),
                   mean=my.mean,
                   sd=my.sd,
                   se=my.se)

my.df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
groups mean sd se
climatechange climate change 27.4 34.7 5.29
climateskeptics climate skeptics 23.0 51.1 6.33
ggplot(my.df, aes(x=groups, y=mean)) + 
  geom_bar(stat="identity", aes(x=groups, y=mean),size=0.1,
           width = 0.6, fill=c("steelblue3")) + 
  theme(
    axis.text.x = element_text(colour="black", size =12),
    axis.text.y = element_text(colour="black", size =10), 
    axis.title.x = element_text( colour="black", size=12),
    axis.title.y = element_text( colour="black", size=12))+
  labs(x="",y="deliberative complexity of threads", title="Thread level data")+
  geom_errorbar(aes(ymin = mean-my.se, ymax = mean+my.se), width=.1)

# thread level data + grouped for subreddits

df <- thread_data %>% 
  dplyr::group_by(subreddit, wave, opposing)%>%
  dplyr::summarise(se = sd(del_complexity)/sqrt(length(del_complexity)),
                     mean = mean(del_complexity))

df%>%
  xtable()%>%
  kable()%>% 
  kable_styling(bootstrap_options = "striped",
                full_width = FALSE,
                position = "center")
subreddit wave opposing se mean
climatechange australia 0 9.61 45.30
climatechange australia 1 7.76 15.60
climatechange california 0 3.31 12.62
climatechange california 1 4.67 6.40
climateskeptics australia 0 5.83 13.23
climateskeptics australia 1 NA 92.00
climateskeptics california 0 9.15 28.02
climateskeptics california 1 1.35 2.88
ggplot(df, aes(x=opposing, y=mean, fill = subreddit)) +
  geom_bar(position=position_dodge(), stat="identity", colour='white') +
  geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.1,position=position_dodge(.9))+
  theme_minimal()+
  scale_fill_manual(values=c("seagreen", "seagreen3"))+
  labs(x="opposing submission content",y="deliberative complexity of threads", title="Thread level data")+
  facet_grid(vars(wave))

T-Test for opposing vs. congruent submissions

# overall t-test
t.test(thread_data$del_complexity ~ thread_data$opposing)

    Welch Two Sample t-test

data:  thread_data$del_complexity by thread_data$opposing
t = 2, df = 59, p-value = 0.03
alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
95 percent confidence interval:
  1.14 30.16
sample estimates:
mean in group 0 mean in group 1 
           27.5            11.8 

ANOVA for opposing vs. congruent x wave

summary(aov(del_complexity ~ opposing + wave + opposing * wave, data = thread_data))
               Df Sum Sq Mean Sq F value Pr(>F)
opposing        1   3836    3836    1.90   0.17
wave            1   2923    2923    1.45   0.23
opposing:wave   1    865     865    0.43   0.51
Residuals     104 210373    2023               

ANOVA for opposing vs. congruent x ideology (subreddit)

summary(aov(del_complexity ~ opposing + subreddit + opposing * subreddit, data = thread_data))
                    Df Sum Sq Mean Sq F value Pr(>F)
opposing             1   3836    3836    1.87   0.17
subreddit            1    933     933    0.46   0.50
opposing:subreddit   1    356     356    0.17   0.68
Residuals          104 212871    2047               

3-way ANOVA for opposing vs. congruent x ideology (subreddit) x wave

summary(aov(del_complexity ~ opposing + subreddit + wave + opposing * subreddit + opposing * wave + subreddit * wave + 
              subreddit * opposing * wave, data = thread_data))
                         Df Sum Sq Mean Sq F value Pr(>F)  
opposing                  1   3836    3836    1.97  0.164  
subreddit                 1    933     933    0.48  0.491  
wave                      1   2105    2105    1.08  0.301  
opposing:subreddit        1    368     368    0.19  0.665  
opposing:wave             1   1643    1643    0.84  0.361  
subreddit:wave            1   4850    4850    2.49  0.118  
opposing:subreddit:wave   1   9264    9264    4.75  0.032 *
Residuals               100 194998    1950                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1